package com.smag.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.smag.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * @TableName farm_order
 */
@TableName(value ="farm_order")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FarmOrder implements Serializable {
    /**
     * 单号
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    //单号
    @Excel(name = "订单号")
    private Long orderId;
    //收货人
    @Excel(name = "收货人")
    private String name;
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Excel(name = "状态")
    private String status;
    /**
     *
     */
    @Excel(name = "电话号码")
    private String phonenumber;

    /**
     * 收货人地址
     */
    @Excel(name = "收货地址")
    private String address;



    /**
     * 创建者
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FarmOrder farmOrder = (FarmOrder) o;
        return Objects.equals(id, farmOrder.id) && Objects.equals(status, farmOrder.status) && Objects.equals(phonenumber, farmOrder.phonenumber) && Objects.equals(address, farmOrder.address) && Objects.equals(createBy, farmOrder.createBy) && Objects.equals(price, farmOrder.price) && Objects.equals(createTime, farmOrder.createTime) && Objects.equals(updateBy, farmOrder.updateBy) && Objects.equals(updateTime, farmOrder.updateTime) && Objects.equals(remark, farmOrder.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, status, phonenumber, address, createBy, price, createTime, updateBy, updateTime, remark);
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;
    @Excel(name = "实付款")
    private BigDecimal price;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "创建时间")
    private Date createTime;

    /**
     *
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;

    /**
     *
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);


        sb.append(", phonenumber=").append(phonenumber);
        sb.append(", address=").append(address);

        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
